home *** CD-ROM | disk | FTP | other *** search
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:saxon="http://icl.com/saxon"
- xmlns:map-foldl-func="map-foldl-func"
- exclude-result-prefixes="xsl saxon map-foldl-func"
- >
- <xsl:import href="foldl.xsl"/>
-
- <map-foldl-func:map-foldl-func/>
-
- <xsl:template name="map">
- <xsl:param name="pFun" select="/.."/>
- <xsl:param name="pList1" select="/.."/>
-
- <xsl:variable name="vFoldlFun" select="document('')/*/map-foldl-func:*[1]"/>
-
- <xsl:variable name="vFuncComposition">
- <xsl:copy-of select="$vFoldlFun"/>
- <xsl:copy-of select="$pFun"/>
- </xsl:variable>
-
- <xsl:variable name="vFComposition"
- select="saxon:node-set($vFuncComposition)/*"/>
-
- <xsl:call-template name="foldl">
- <xsl:with-param name="pFunc" select="$vFComposition"/>
- <xsl:with-param name="pList" select="$pList1"/>
- <xsl:with-param name="pA0" select="/.."/>
- </xsl:call-template>
- </xsl:template>
-
-
- <xsl:template name="mapL" match="*[namespace-uri() = 'map-foldl-func']">
- <xsl:param name="arg0" select="/.."/>
- <xsl:param name="arg1" select="/.."/>
- <xsl:param name="arg2" select="/.."/>
-
- <!-- $arg1 must be A0 -->
- <xsl:copy-of select="$arg1"/>
-
- <xsl:variable name="vFun1Result">
- <xsl:apply-templates select="$arg0[1]">
- <xsl:with-param name="arg1" select="$arg2[1]"/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:apply-templates select="$arg2" mode="copy">
- <xsl:with-param name="pContents" select="saxon:node-set($vFun1Result)"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="*" mode="copy">
- <xsl:param name="pContents"/>
-
- <xsl:copy>
- <xsl:copy-of select="$pContents"/>
- </xsl:copy>
- </xsl:template>
-
- </xsl:stylesheet>